package com.ruben.features;

import java.util.ArrayList;
import java.util.Collection;

/**
 * instanceOf 案例
 *
 * @author <achao1441470436@gmail.com>
 * @since 2021/7/18 17:45
 */
public class InstanceOfDemo {
    public static void main(String[] args) {
        Collection<String> collection = new ArrayList<>();
        if (collection instanceof ArrayList arrayList) {
            arrayList.forEach(System.out::println);
        }
    }
}
